/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.engagesoft.cashflow.entidades;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author rchajin
 */
@Entity
@Table(name = "concepto")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Concepto.findAll", query = "SELECT c FROM Concepto c"),
    @NamedQuery(name = "Concepto.findByIdConcepto", query = "SELECT c FROM Concepto c WHERE c.idConcepto = :idConcepto"),
    @NamedQuery(name = "Concepto.findByNombreConcepto", query = "SELECT c FROM Concepto c WHERE c.nombreConcepto = :nombreConcepto"),
    @NamedQuery(name = "Concepto.findByIndHabilitadoconcepto", query = "SELECT c FROM Concepto c WHERE c.indHabilitadoconcepto = :indHabilitadoconcepto")})
public class Concepto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_concepto")
    private Integer idConcepto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "nombre_concepto")
    private String nombreConcepto;
    @Basic(optional = false)
    @NotNull
    @Column(name = "indHabilitado_concepto")
    private boolean indHabilitadoconcepto;
    @OneToMany(mappedBy = "idConcepto")
    private Collection<MovimientoDocumento> movimientoDocumentoCollection;

    public Concepto() {
    }

    public Concepto(Integer idConcepto) {
        this.idConcepto = idConcepto;
    }

    public Concepto(Integer idConcepto, String nombreConcepto, boolean indHabilitadoconcepto) {
        this.idConcepto = idConcepto;
        this.nombreConcepto = nombreConcepto;
        this.indHabilitadoconcepto = indHabilitadoconcepto;
    }

    public Integer getIdConcepto() {
        return idConcepto;
    }

    public void setIdConcepto(Integer idConcepto) {
        this.idConcepto = idConcepto;
    }

    public String getNombreConcepto() {
        return nombreConcepto;
    }

    public void setNombreConcepto(String nombreConcepto) {
        this.nombreConcepto = nombreConcepto;
    }

    public boolean getIndHabilitadoconcepto() {
        return indHabilitadoconcepto;
    }

    public void setIndHabilitadoconcepto(boolean indHabilitadoconcepto) {
        this.indHabilitadoconcepto = indHabilitadoconcepto;
    }

    @XmlTransient
    public Collection<MovimientoDocumento> getMovimientoDocumentoCollection() {
        return movimientoDocumentoCollection;
    }

    public void setMovimientoDocumentoCollection(Collection<MovimientoDocumento> movimientoDocumentoCollection) {
        this.movimientoDocumentoCollection = movimientoDocumentoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idConcepto != null ? idConcepto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Concepto)) {
            return false;
        }
        Concepto other = (Concepto) object;
        if ((this.idConcepto == null && other.idConcepto != null) || (this.idConcepto != null && !this.idConcepto.equals(other.idConcepto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.engagesoft.cashflow.entidades.Concepto[ idConcepto=" + idConcepto + " ]";
    }
    
}
